package com.zhongfl.crm.model.boss;

import com.zhongfl.crm.enums.boss.WorkOrderTypeCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

/**
 * 工单数量统计结果
 *
 * @author wang.yuchuan
 * @date 2018/5/16
 */
@Getter
@Setter
public class WorkOrderCountStatisticsResult {

    private static final long serialVersionUID = 4096358758475687738L;

    public WorkOrderCountStatisticsResult() {

    }

    public WorkOrderCountStatisticsResult(WorkOrderTypeCode workOrderTypeCode, Integer count) {
        this.workOrderTypeCode = workOrderTypeCode;
        this.count = count;
    }

    /**
     * 工单类型
     */
    private WorkOrderTypeCode workOrderTypeCode;

    /**
     * 库名称
     */
    private String storeName;

    public String getStoreName() {
        if(StringUtils.isNotEmpty(storeName)){
            return storeName;
        }
        if (Objects.nonNull(workOrderTypeCode)) {
            return workOrderTypeCode.getStoreName();
        }
        return StringUtils.EMPTY;
    }

    /**
     * 在库数量
     */
    private Integer count;

    /**
     * 入库数量
     */
    private Integer inStoreCount;

    /**
     * 出库数量
     */
    private Integer outStoreCount;
}
